package com.wuliang.blog.entities;

import com.google.gson.annotations.Expose;
import com.wuliang.blog.core.basic.BasicEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * @author WuLiang
 */
@Data
@Entity
@ApiModel(description = "文章")
@EqualsAndHashCode(callSuper = true)
@Table(name = "t_article", schema = "wu_liang_blog")
public class Article extends BasicEntity {

    @Expose
    @Column(name = "article_content", columnDefinition = "text default null comment '文章内容'")
    @ApiModelProperty(name = "articleContent", value = "文章内容", dataType = "string")
    private String articleContent;

    @Expose
    @Column(name = "article_title", columnDefinition = "varchar(255) not null default '' comment '文章标题'")
    @ApiModelProperty(name = "articleTitle", value = "文章标题", dataType = "string")
    private String articleTitle = "";

    @Expose
    @Column(name = "classification_id", columnDefinition = "int(10) default 0 comment '所属分类'")
    @ApiModelProperty(name = "classificationId", value = "所属分类ID", dataType = "int")
    private Integer classificationId = 0;

}
